using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Be.Timvw.Framework.Windows.Forms.Tests.TypeTree
{
    [TestClass]
    public class WhenGettingTypeImageKey
    {
        [TestMethod]
        public void ShouldReturnInterfaceWhenTypeIsInterface()
        {
            Type interfaceType = typeof(Dummy4Interface);
            string expected = "interface.gif";

            string actual = Be.Timvw.Framework.Windows.Forms.TypeTree.GetTypeImageKey(interfaceType);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void ShouldReturnClassWhenTypeIsClass()
        {
            Type classType = typeof(Dummy1Class);
            string expected = "class.gif";

            string actual = Be.Timvw.Framework.Windows.Forms.TypeTree.GetTypeImageKey(classType);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void ShouldReturnStructureWhenTypeIsStruct()
        {
            Type structType = typeof(Dummy2Struct);
            string expected = "structure.gif";

            string actual = Be.Timvw.Framework.Windows.Forms.TypeTree.GetTypeImageKey(structType);
            Assert.AreEqual(expected, actual);
        }

        [TestMethod]
        public void ShouldReturnEnumWhenTypeIsEnum()
        {
            Type enumType = typeof(Dummy3Enum);
            string expected = "enum.gif";

            string actual = Be.Timvw.Framework.Windows.Forms.TypeTree.GetTypeImageKey(enumType);
            Assert.AreEqual(expected, actual);
        }
    }
}